package com.enjoy.adv.kryocodec;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;

import java.util.List;

/**
 * Created by HP on 2019/7/18.
 * 反序列化handler 解码
 */
public class kryoDecoder extends ByteToMessageDecoder {
    @Override
    protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
        Object obj=KryoSerializer.deSerialize(in);
        out.add(obj);
    }
}
